import request from "@/utils/request";

// 查询所有角色
export function queryAllApi() {
  return request({
    url: "/roles/list",
    method: "get",
  }); 
}

// 角色信息分页查询
export function queryPageApi(params) {
  return request({
    url: "/roles",
    method: "get",
    params,
  });
}

// 根据ID查询角色
export function queryByIdApi(id) {
  return request({
    url: `/roles/${id}`,
    method: "get",
  });
}

// 添加角色
export function addApi(data) {
  return request({
    url: "/roles",
    method: "post",
    data,
  });
}

// 修改角色
export function updateApi(data) {
  return request({
    url: "/roles",
    method: "put",
    data,
  });
}

// 删除角色
export function deleteApi(id) {
  return request({
    url: `/roles/${id}`,
    method: "delete",
  });
}
